package com.example.net.websocket.bean;

import androidx.annotation.IntDef;

import com.alibaba.fastjson.annotation.JSONField;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

public class CarResponse {
    @IntDef(value = {CarResponseType.CAR_IN, CarResponseType.CAR_OUT})
    @Retention(RetentionPolicy.SOURCE)
    public @interface CarResponseType {
        int CAR_IN = 1;
        int CAR_OUT = 0;
    }

    @JSONField(name = "type")
    private Integer type;
    @JSONField(name = "data")
    private DataDTO data;

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public DataDTO getData() {
        return data;
    }

    public void setData(DataDTO data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "CarResponse{" +
                "type=" + type +
                ", data=" + data +
                '}';
    }

    public static class DataDTO {
        @JSONField(name = "userId")
        private String userId;
        private String carId;
        private String roomId;
        private String rtsToken;

        public String getCarId() {
            return carId;
        }

        public void setCarId(String carId) {
            this.carId = carId;
        }

        public String getRoomId() {
            return roomId;
        }

        public void setRoomId(String roomId) {
            this.roomId = roomId;
        }

        public String getRtsToken() {
            return rtsToken;
        }

        public void setRtsToken(String rtsToken) {
            this.rtsToken = rtsToken;
        }

        public String getUserId() {
            return userId;
        }

        public void setUserId(String userId) {
            this.userId = userId;
        }

        @Override
        public String toString() {
            return "DataDTO{" +
                    "userId='" + userId + '\'' +
                    ", carId='" + carId + '\'' +
                    ", roomId='" + roomId + '\'' +
                    ", rtsToken='" + rtsToken + '\'' +
                    '}';
        }
    }
}
